package Shape;

public class ShapeFactory {
    public static Shape createShape(String shape) throws UnsupportedShapeException {
        if(shape.equals("circle")) {
            return new Circle();
        }
        else if(shape.equals("rectangle")) {
            return new Rectangle();
        }
        else if(shape.equals("triangle")) {
            return new Triangle();
        }
        throw new UnsupportedShapeException("UnsupportedShapeException");
    }
}
